//
// Created by v on 19-4-22.
//

#ifndef CUTEDEVICE_CMCOMMANDINSTANCE_H
#define CUTEDEVICE_CMCOMMANDINSTANCE_H

#include <iostream>
#include <list>
#include <stdio.h>
#include <time.h>

#define LOGD(fmt, ...)                                                         \
    do                                                                         \
    {                                                                          \
        printf("[%s]%s:%d(%lu) ", __FILE__, __func__, __LINE__, time(NULL));   \
        printf(fmt, ##__VA_ARGS__);                                            \
    } while (0)

class CMCommandInstance
{
  public:
    CMCommandInstance(std::string name, std::string description);
    virtual ~CMCommandInstance();

    std::string getShellPath();

    void showUsage();

    // Start test, push args to m_args, then call testCommand which implement by
    // child class.
    int startTest(int argc, char **args);

    virtual int testCommand() = 0;

  private:
    std::string            m_name;
    std::string            m_description;
    std::list<std::string> m_args;
};

#endif // CUTEDEVICE_CMCOMMANDINSTANCE_H
